:root {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  font-weight: 400;

  /* 浅色模式配色方案 */
  --primary-color: #1a73e8;
  --primary-hover: #1765cc;
  --primary-light: #e8f0fe;
  --text-color: #333333;
  --light-text: #6e6e6e;
  --border-color: #e0e0e0;
  --background: #f8f9fa;
  --card-background: #ffffff;
  --success: #34a853;
  --warning: #fbbc05;
  --error: #ea4335;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;

  color-scheme: light dark;
  color: var(--text-color);
  background-color: var(--background);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

/* 深色模式样式 - 更新为使用data-theme属性 */
[data-theme="dark"] {
  --text-color: #f0f0f0;
  --light-text: #b0b0b0;
  --background: #121212;
  --card-background: #1e1e1e;
  --border-color: #2c2c2c;
  --primary-light: #192e4d;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 原有的媒体查询部分可以保留，但添加新的样式来确保深色模式下的元素正确显示 */
[data-theme="dark"] button {
  background-color: var(--primary-color);
  color: white;
}

[data-theme="dark"] .vendor-tab {
  background-color: #252525;
  color: #e0e0e0;
}

[data-theme="dark"] select, 
[data-theme="dark"] textarea {
  background-color: #2a2a2a;
  color: #ffffff;
  border-color: #555;
}

[data-theme="dark"] select option {
  background-color: #2a2a2a;
  color: #ffffff;
}

/* 增加下拉箭头的可见度 */
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* 输入框的占位符文本 */
[data-theme="dark"] ::placeholder {
  color: #aaaaaa;
  opacity: 1;
}

/* 焦点状态下的表单元素 */
[data-theme="dark"] textarea:focus, 
[data-theme="dark"] select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.3);
}

[data-theme="dark"] .download-btn {
  color: white;
}

[data-theme="dark"] audio {
  background-color: #252525;
}

/* 主题切换按钮样式 */
.theme-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover {
  transform: rotate(12deg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

button {
  border-radius: var(--radius);
  border: none;
  padding: 0.8em 1.6em;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  background-color: var(--primary-color);
  color: white;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

button:disabled {
  background-color: #cccccc;
  color: #888888;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

button:focus,
button:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* 表单样式 */
select, textarea {
  width: 100%;
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
  font-size: 1rem;
  transition: var(--transition);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

textarea:focus, select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

label {
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
  color: var(--text-color);
}

form > div {
  margin-bottom: 20px;
}

/* 卡片容器 */
.card {
  background: var(--card-background);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 32px;
  margin: 20px auto;
  transition: var(--transition);
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 标题样式 */
h1, h2, h3 {
  color: var(--text-color);
  line-height: 1.3;
}

h2 {
  font-size: 1.8rem;
  margin-top: 0;
  margin-bottom: 24px;
  text-align: center;
}

/* 音频播放器样式 */
audio {
  width: 100%;
  margin-top: 16px;
  margin-bottom: 16px;
  border-radius: var(--radius);
}

/* 下载按钮 */
.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background-color: var(--success);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 500;
  transition: var(--transition);
}

.download-btn:hover {
  background-color: #2d9348;
  transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .card {
    padding: 24px;
  }
}

/* 加载动画 */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* 顶部厂商标签导航 */
.vendor-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.vendor-tab {
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  background-color: var(--background);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.vendor-tab.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.vendor-tab:hover:not(.active) {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
}
